$gameData = {
    9: { // 九宫格
        board: [1, 2, 3, 4, 5, 6, 7, 8, 0],
        block: [1, 2, 3, 4, 5, 6, 7, 8, 0],
        direction: [
            [1, 3],
            [0, 2, 4],
            [1, 5],
            [0, 4, 6],
            [1, 3, 5, 7],
            [2, 4, 8],
            [3, 7],
            [4, 6, 8],
            [5, 7]
        ],
        xy: [
            [0, 0],
            [0, 120],
            [0, 240],
            [120, 0],
            [120, 120],
            [120, 240],
            [240, 0],
            [240, 120],
            [240, 240]
        ],
        blockDOM: ''
    },
    16: { // 十六宫格
        board: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0],
        block: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0],
        direction: [
            [1, 4],
            [0, 2, 5],
            [1, 3, 6],
            [2, 7],
            [0, 5, 8],
            [1, 4, 6, 9],
            [2, 5, 7, 10],
            [3, 6, 11],
            [4, 9, 12],
            [5, 8, 10, 13],
            [6, 9, 11, 14],
            [7, 10, 15],
            [8, 13],
            [9, 12, 14],
            [10, 13, 15],
            [11, 14]
        ],
        xy: [
            [0, 0],
            [0, 90],
            [0, 180],
            [0, 270],
            [90, 0],
            [90, 90],
            [90, 180],
            [90, 270],
            [180, 0],
            [180, 90],
            [180, 180],
            [180, 270],
            [270, 0],
            [270, 90],
            [270, 180],
            [270, 270]
        ],
        blockDOM: ''
    },
    25: { // 二十五宫格
        board: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0],
        block: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0],
        direction: [
            [1, 5],
            [0, 2, 6],
            [1, 3, 7],
            [2, 4, 8],
            [3, 9],
            [0, 6, 10],
            [1, 5, 7, 11],
            [2, 6, 8, 12],
            [3, 7, 9, 13],
            [4, 8, 14],
            [5, 11, 15],
            [6, 10, 12, 16],
            [7, 11, 13, 17],
            [8, 12, 14, 18],
            [9, 13, 19],
            [10, 16, 20],
            [11, 15, 17, 21],
            [12, 16, 18, 22],
            [13, 17, 19, 23],
            [14, 18, 24],
            [15, 21],
            [16, 20, 22],
            [17, 21, 23],
            [18, 22, 24],
            [19, 23]
        ],
        xy: [
            [0, 0],
            [0, 72],
            [0, 144],
            [0, 216],
            [0, 288],
            [72, 0],
            [72, 72],
            [72, 144],
            [72, 216],
            [72, 288],
            [144, 0],
            [144, 72],
            [144, 144],
            [144, 216],
            [144, 288],
            [216, 0],
            [216, 72],
            [216, 144],
            [216, 216],
            [216, 288],
            [288, 0],
            [288, 72],
            [288, 144],
            [288, 216],
            [288, 288]
        ],
        blockDOM: ''
    }
}

let $gameDataLeves = [9, 16, 25]; // 游戏难度
let $currentLevel = 9; // 游戏当前难度

// 生成滑块DOM
$gameDataLeves.forEach(function (item_i) {
    let html = '';
    $gameData[item_i].block.forEach(function (item_j) {
        if (item_j !== 0) {
            html += '<div class="game' + item_i + 'd' + item_j + '" id="d' + item_j + '" onclick="clickBlock(' + item_j + ')">' + item_j + '</div>';
        }
    });
    $gameData[item_i].blockDOM = html;
});